package com.yjj.demo.thread.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;

/**
 *
 *
 * @author yangjiajia
 * @time 2021/9/4 16:26
 */
@Service
public class TestService {

    private Logger logger = LoggerFactory.getLogger(TestService.class);

    @Autowired
    private TaskExecutor taskExecutor;

    public void taskTest() {
        logger.info("task...");

        taskExecutor.execute(new Runnable() {
            @Override
            public void run() {
                logger.info("aaa");
            }
        });
    }
}
